/*
RNAvigator is a tool for visualizing secondary structure of RNA
Copyright 2012 Elias La Cour & Peter Bertelsen

This file is part of RNAvigator.

RNAvigator is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

RNAvigator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with RNAvigator.  If not, see <http://www.gnu.org/licenses/>.
*/
package rnavigator.model;

import java.awt.geom.Arc2D;

/**
 *
 * @author Elias la Cour & Peter Bertelsen
 * 
 * =====UnitCircleArc=====
 * Class contains variables for Arc2D.setArcByCenter()
 * Necessary in order to scale up arcs.
 * Another more elegant solution could be to implement a new drawArcmethod.
 */

public class UnitCircleArc {

    private Arc2D arc;
    private double x;
    private double y;
    private double radius;
    private double angSt;
    private double angExt;
    private int closure;

    public UnitCircleArc() {
    }

    public UnitCircleArc(double x, double y, double radius, double angSt, double angExt, int closure) {
        this.x = x;
        this.y = y;
        this.radius = radius;
        this.angSt = angSt;
        this.angExt = angExt;
        this.closure = closure;
    }

    public Arc2D getArc() {
        setArc(new Arc2D.Double());
        arc.setArcByCenter(getX(), getY(), getRadius(), getAngSt(), getAngExt(), getClosure());
        return arc;
    }
    /**
     * @param multiplies UCRadius, x and y values by radius 
     * @return a Arc2D using setArcByCenter()
     */
    public Arc2D getArc(double radius) {
        setArc(new Arc2D.Double());
        arc.setArcByCenter(getX()*radius, getY()*radius, getRadius()*radius, getAngSt(), getAngExt(), getClosure());
        return arc;
    }

    /**
     * @param arc the arc to set
     */
    public void setArc(Arc2D arc) {
        this.arc = arc;
    }

    /**
     * @return the x
     */
    public double getX() {
        return x;
    }

    /**
     * @param x the x to set
     */
    public void setX(double x) {
        this.x = x;
    }

    /**
     * @return the y
     */
    public double getY() {
        return y;
    }

    /**
     * @param y the y to set
     */
    public void setY(double y) {
        this.y = y;
    }

    /**
     * @return the radius
     */
    public double getRadius() {
        return radius;
    }

    /**
     * @param radius the radius to set
     */
    public void setRadius(double radius) {
        this.radius = radius;
    }

    /**
     * @return the angSt
     */
    public double getAngSt() {
        return angSt;
    }

    /**
     * @param angSt the angSt to set
     */
    public void setAngSt(double angSt) {
        this.angSt = angSt;
    }

    /**
     * @return the angExt
     */
    public double getAngExt() {
        return angExt;
    }

    /**
     * @param angExt the angExt to set
     */
    public void setAngExt(double angExt) {
        this.angExt = angExt;
    }

    /**
     * @return the closure
     */
    public int getClosure() {
        return closure;
    }

    /**
     * @param closure the closure to set
     */
    public void setClosure(int closure) {
        this.closure = closure;
    }
}
